/* AI分析页面样式 */

/* 标签页样式 */
.tab {
    transition: all 0.3s ease;
    cursor: pointer;
}

.tab:hover {
    background: rgba(102, 126, 234, 0.05);
}

.tab.active {
    background: var(--primary-gradient);
    color: white;
}

/* 数据源卡片 */
.datasource-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.datasource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 任务卡片 */
.task-card {
    transition: all 0.3s ease;
}

.task-card:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 进度条 */
.progress-bar {
    transition: width 0.3s ease;
}

/* 服务卡片 */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 状态指示器 */
.status-indicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* 数据源类型选择 */
.datasource-type {
    transition: all 0.3s ease;
}

.datasource-type:hover {
    border-color: #6366f1;
}

.datasource-type.selected {
    border-color: #6366f1;
    background-color: #eef2ff;
}

/* 模态框动画 */
.modal {
    transition: all 0.3s ease;
}

.modal-content {
    transition: all 0.3s ease;
}

/* 通知样式 */
.notification {
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 表格样式 */
.preview-table {
    min-width: 100%;
    border-collapse: collapse;
}

.preview-table th,
.preview-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.preview-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.preview-table tr:hover {
    background-color: #f8fafc;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

/* 加载状态 */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .datasource-card {
        padding: 1rem;
    }

    .preview-table {
        font-size: 0.875rem;
    }

    .preview-table th,
    .preview-table td {
        padding: 0.5rem;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .tab:hover {
        background: rgba(102, 126, 234, 0.1);
    }

    .preview-table th {
        background-color: #1f2937;
        color: #f9fafb;
    }

    .preview-table tr:hover {
        background-color: #374151;
    }

    .pagination button {
        background-color: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .pagination button:hover:not(:disabled) {
        background-color: #4b5563;
        border-color: #6b7280;
    }
}

/* 统计卡片样式优化 */
.datasource-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--stat-color-start) 0%, var(--stat-color-end) 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-card.total {
    --stat-color-start: #3b82f6;
    --stat-color-end: #1d4ed8;
}

.stat-card.warning {
    --stat-color-start: #f59e0b;
    --stat-color-end: #d97706;
}

.stat-card.active {
    --stat-color-start: #10b981;
    --stat-color-end: #047857;
}

.stat-card.error {
    --stat-color-start: #f59e0b;
    --stat-color-end: #d97706;
}

.stat-card.excel {
    --stat-color-start: #8b5cf6;
    --stat-color-end: #7c3aed;
}

.stat-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.stat-card-info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
    margin: 0 0 0.5rem 0;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin: 0;
}

.stat-card-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    .stat-card-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}

/* 动画效果 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card-value {
    animation: countUp 0.6s ease-out;
}